<template>
  <a-drawer v-model:visible="visible" title="商铺认证详情" :width="width >= 580 ? 580 : '100%'" :footer="false">
    <a-descriptions :column="2" size="large" class="general-description">
      <a-descriptions-item label="主键">{{ dataDetail?.id }}</a-descriptions-item>
      <a-descriptions-item label="用户ID">{{ dataDetail?.accountId }}</a-descriptions-item>
      <a-descriptions-item label="企业名称">{{ dataDetail?.companyName }}</a-descriptions-item>
      <a-descriptions-item label="企业税号">{{ dataDetail?.companyTax }}</a-descriptions-item>
      <a-descriptions-item label="银行卡号">{{ dataDetail?.cardNo }}</a-descriptions-item>
      <a-descriptions-item label="开户行支行地址">{{ dataDetail?.bankAddress }}</a-descriptions-item>
      <a-descriptions-item label="法人姓名">{{ dataDetail?.name }}</a-descriptions-item>
      <a-descriptions-item label="身份证号码">{{ dataDetail?.personId }}</a-descriptions-item>
      <a-descriptions-item label="支付宝账号">{{ dataDetail?.alipayNo }}</a-descriptions-item>
      <a-descriptions-item label="店铺名称">{{ dataDetail?.shopName }}</a-descriptions-item>
      <a-descriptions-item label="主营类目">{{ dataDetail?.businessCategory }}</a-descriptions-item>
      <a-descriptions-item label="营业执照副本">{{ dataDetail?.businessLicense }}</a-descriptions-item>
      <a-descriptions-item label="法人身份证正面">{{ dataDetail?.passportFaceImg }}</a-descriptions-item>
      <a-descriptions-item label="法人身份证背面">{{ dataDetail?.passportSideImg }}</a-descriptions-item>
      <a-descriptions-item label="法人身份证手持">{{ dataDetail?.passportHandImg }}</a-descriptions-item>
      <a-descriptions-item label="公户银行卡正面">{{ dataDetail?.bankcardFront }}</a-descriptions-item>
      <a-descriptions-item label="公户银行卡背面">{{ dataDetail?.bankcardEnd }}</a-descriptions-item>
      <a-descriptions-item label="审核不通过次数">{{ dataDetail?.failNum }}</a-descriptions-item>
      <a-descriptions-item label="审核状态">{{ dataDetail?.status }}</a-descriptions-item>
      <a-descriptions-item label="错误信息">{{ dataDetail?.errMsg }}</a-descriptions-item>
      <a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
      <a-descriptions-item label="修改时间">{{ dataDetail?.updateTime }}</a-descriptions-item>
      <a-descriptions-item label="创建人">{{ dataDetail?.createUser }}</a-descriptions-item>
      <a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
      <a-descriptions-item label="修改人">{{ dataDetail?.updateUser }}</a-descriptions-item>
      <a-descriptions-item label="修改人">{{ dataDetail?.updateUserString }}</a-descriptions-item>
    </a-descriptions>
  </a-drawer>
</template>

<script lang="ts" setup>
import { useWindowSize } from '@vueuse/core'
import { type PersonShopIdentificationDetailResp, getPersonShopIdentification } from '@/apis'

const { width } = useWindowSize()

const visible = ref(false)
const dataId = ref('')
const dataDetail = ref<PersonShopIdentificationDetailResp>()
// 查询详情
const getDataDetail = async () => {
  const res = await getPersonShopIdentification(dataId.value)
  dataDetail.value = res.data
}

// 打开详情
const onDetail = async (id: string) => {
  dataId.value = id
  await getDataDetail()
  visible.value = true
}

defineExpose({ onDetail })
</script>

<style lang="scss" scoped></style>
